<template>
	<view class="content">
		<text style="font-size: 50rpx;">子组件</text>
		<view class="coma-box">
			<text>父组件传进来的值：</text>
			<text style="font-weight: bold;color: red;">{{intent}}</text>
		</view>
		<button type="primary" @click="sendData()">传值给comB组件</button>
	</view>
</template>

<script>
	export default {
		name: "compA",
		props: {
			intent: {
				type: String,
				default: ""
			}
		},
		data() {
					return {
						
					};
				},
				mounted() {
							console.log("comA----mounted");
						},
				methods: {
					sendData() {
						console.log("");
						this.$emit("sendTocomB",this.intent);
					}
				}
			};
</script>

<style>
.content {
	background: #f9c784;
	padding: 20rpx;
	margin: 20rpx 0;
}

.button {
	background: #409eff;
	color: #fff;
	padding: 10rpx 20rpx;
	border: none;
	margin-top: 10rpx;
}
</style>